package asteroids.engine.ai;

import java.awt.event.KeyEvent;

import asteroids.engine.GameState;
import asteroids.engine.KeyboardMonitor;

public class KeyboardPilot implements Pilot
{
    @Override
    public int getOrders(GameState state)
    {
        int orders = 0;

        if( KeyboardMonitor.getKeyDown(KeyEvent.VK_UP) )
        {
            orders = orders | Pilot.UP;
        }
        if( KeyboardMonitor.getKeyDown(KeyEvent.VK_LEFT) )
        {
            orders = orders | Pilot.LEFT;
        }
        if( KeyboardMonitor.getKeyDown(KeyEvent.VK_RIGHT) )
        {
            orders = orders | Pilot.RIGHT;
        }
        if( KeyboardMonitor.getKeyDown(KeyEvent.VK_Z) )
        {
            orders = orders | Pilot.FIRE;
        }
        if( KeyboardMonitor.getKeyDown(KeyEvent.VK_X) )
        {
            orders = orders | Pilot.SPECIAL;
        }
        return orders;
    }

}
